package info.empathymobile.monitor.receivers;

import info.empathymobile.monitor.EmpathyMonitorService;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;


public class BootReceiver extends BroadcastReceiver {

	@Override
	public void onReceive(Context context, Intent intent) {
		Intent serviceIntent = new Intent(context, EmpathyMonitorService.class);

		if(intent.getAction().equals(Intent.ACTION_PACKAGE_REPLACED)){
			context.stopService(serviceIntent);
		}
		context.startService(serviceIntent);
	}
}
